package com.glela.packet.exception;

public class RedPacketBizException extends RuntimeException {

  public static final RedPacketBizException RED_PACKET_RECORD_NOT_EXIST = new RedPacketBizException(100000, "兔币发行记录不存在");
  public static final RedPacketBizException RED_PACKET_RECORD_IS_DELETE = new RedPacketBizException(100001, "兔币发行记录已被删除");
  public static final RedPacketBizException RED_PACKET_RECORD_IS_NOT_ENABLE = new RedPacketBizException(100002, "兔币发行记录不是启用状态");
  public static final RedPacketBizException RED_PACKET_RECORD_TIME_IS_INVALID = new RedPacketBizException(100003, "当前时间不是在兔币发行范围之内");
  public static final RedPacketBizException PARAM_ERROR = new RedPacketBizException(999999, "参数错误");
  private int code;

  private String message;

  public RedPacketBizException() {
    super();
  }

  public RedPacketBizException(String message) {
    super(message);
    this.message = message;
    this.code = 999999;
  }

  public RedPacketBizException(int code, String message) {
    this.code = code;
    this.message = message;
  }

  public int getCode() {
    return code;
  }

  public void setCode(int code) {
    this.code = code;
  }

  @Override
  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }

  @Override
  public String toString() {
    return "RedPacketBizException{" +
        "code=" + code +
        ", message='" + message + '\'' +
        '}';
  }
}
